package com.kwlt.smc.util;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;

/**
 * 常用工具类
 * @author xushunxin
 *
 */
public class ConUtils {
	/**
	 * 获取系统时间唯一值
	 * @return
	 */
	public static String formatseq(){
		 SimpleDateFormat sft = new SimpleDateFormat("yyyyMMddHHmmssSSS");
		return sft.format(System.currentTimeMillis());
	}
	
	public static void closeStatement(Statement st){
		try {
			st.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static void closeConnection(Connection conn){
		try {
			conn.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static void threadSleep(int millis){
		try {
			Thread.sleep(millis);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
